#include<iostream>
#include<cstdlib>
using namespace std;
const int N = 1e3 + 10;
int main()
{
	int arr[N];
	memset(arr, 0, sizeof(arr));
	int n;
	int key;
	int ansi = -1, ansj = -1;
	cin >> n >> key;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = 0, j = n - 1; i < j; i++) {
		while (arr[i] + arr[j] > key) {
			j--;
		}
		if (arr[i] + arr[j] == key) {
			ansi = i + 1;
			ansj = j + 1;
			break;
		}
	}
	cout << ansi << " " << ansj << endl;
	return 0;
}